package com.lg.algorithm.collections.map;

import com.lg.domain.User;

import java.util.concurrent.ConcurrentHashMap;

/**
 * 锁头，线程安全
 */
public class ConcurrentHashMapFun {
    public static void main(String[] args) {
        ConcurrentHashMap map = new ConcurrentHashMap<User, String>(2);
        for (int i = 0; i < 15; i++) {
            User user = new User();
            map.put(user, "11");
        }
    }
}
